﻿using Entity;
using System.Windows.Media;

namespace FastCopyWin
{
    public class ClipboardDataViewItem
    {
        internal ClipboardData Data { get; set; }

        public string TextData
        {
            get
            {
                if (Data.Type == ClipboardDataType.TEXT)
                {
                    return Data.Data;
                }
                return "";
            }
        }

        public ImageSource? ImageData
        {
            get
            {
                if (Data.Type == ClipboardDataType.IMAGE)
                {
                    return SundayLiUtils.Base64ToWriteableBitmap(Data.Data);
                }
                return null;
            }
        }

        public ClipboardDataViewItem(ClipboardData data)
        {
            this.Data = data;
        }

    }
}
